import { Component, ViewChild, TemplateRef, ChangeDetectionStrategy } from '@angular/core';
import { ModalService } from '@iux/live';

@Component({
  templateUrl: './demo1.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Demo1Component {
  constructor(private modalService: ModalService) {}

  @ViewChild('contentTpl', { static: false }) contentTpl: TemplateRef<any>;

  open() {
    const modal = this.modalService.create({
      lvModalKey: 'myModal',
      lvHeader: 'Title',
      lvContent: this.contentTpl,
      lvWidth: 600,
      lvHeight: 400,
      lvAfterClose: res => {
        console.log(res);
      },
    });
  }
}
